﻿Public Partial Class WebForm1
    Inherits System.Web.UI.Page
    Private objCustomer As Access
    Private objBL As BL
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        objBL = New BL()
        objCustomer = New Access()
        Dim sql As String = "select * from MapInfo"
        Dim ds As DataSet = objCustomer.GetDs(sql)

        For Each t As DataRow In ds.Tables(0).Rows
            Me.HidXS.Value += t("X") + ","
            Me.HidYS.Value += t("Y") + ","
        Next
        Me.HidXS.Value = Me.HidXS.Value.Substring(0, Me.HidXS.Value.Length - 1)
        Me.HidYS.Value = Me.HidYS.Value.Substring(0, Me.HidYS.Value.Length - 1)
        Label2.Text = "在线人数：" + objBL.rs().Tables(0).Rows.Count.ToString()
    End Sub

    Protected Sub Button4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button4.Click
        ' Dim connString As String = ConfigurationManager.ConnectionStrings(Constant.ConnstringName).ConnectionString
        objCustomer = New Access()
        Dim sql As String = "INSERT INTO MapInfo (X,Y,region) VALUES ('" + Me.HiddenX.Value + "', '" + HiddenY.Value + "','" + Me.HiddenRegion.Value + "')"
        objCustomer.DoSql(sql)
        Label1.Text = "保存成功"
    End Sub

    Function BE(ByVal x As String, ByVal y As String) As T01
        Dim t01 As New T01
        t01.X = x
        t01.Y = y

        Return t01
    End Function

    Protected Sub Button5_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button5.Click

    End Sub

    'Protected Sub Button6_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button6.Click
    '    Me.Label2.Text = "fsafasf"
    'End Sub
End Class